Dynomotion

Group: DynoMotion Message: 12622 From: wastingtape Date: 12/28/2015
Subject: Setting G28 Position

I've been trying to figure this out on my own, and here's what I've got so far, but it does not seem to work...


#include "KMotionDef.h"


main()

{

// Set G28 home position

persist.UserData[5161]= 0; //X

persist.UserData[5162]= 93952; //Y

persist.UserData[5163]= 59880; //Z

ch0->InputMode=NO_INPUT_MODE;

        // More channel setup code here...


G28 still sends the machine to some random location.  Am I correct in assuming the value of the 5161-5163 variables are the step counts?  What am I missing?


Group: DynoMotion Message: 12625 From: Hardy Family Date: 12/28/2015
Subject: Re: Setting G28 Position
The persist data is not the same as g-code variables.  Your code is setting some random location in kflop memory since there's only 200 locations in persist.UserData.  Tom has some examples of setting g-code variables - you need to look at the PC communications examples.  G-code variables are only stored on the PC.

Also, the g-code variables would not be in steps, but would be in mm or inch units.  Not sure whether the interpreter automatically converts between mm and inch when you change g20/g21.  So it's probably best to leave those vars as zero, and adjust the zero absolute positions in the kflop so that the g28 home position is where you want it.  Personally, I prefer to use g53g0z<whatever> as a safer alternative to g28, but YMMV.

It would be nice if G28/30 could invoke "user program actions" like the M codes, but it doesn't yet as far as I know.

Regards,
SJH


On Mon, Dec 28, 2015 at 9:38 AM, wastingtape@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

I've been trying to figure this out on my own, and here's what I've got so far, but it does not seem to work...


#include "KMotionDef.h"


main()

{

// Set G28 home position

persist.UserData[5161]= 0; //X

persist.UserData[5162]= 93952; //Y

persist.UserData[5163]= 59880; //Z

ch0->InputMode=NO_INPUT_MODE;

        // More channel setup code here...


G28 still sends the machine to some random location.  Am I correct in assuming the value of the 5161-5163 variables are the step counts?  What am I missing?



Group: DynoMotion Message: 12628 From: TK Date: 12/28/2015
Subject: Re: Setting G28 Position
You can also define the G28 position using the .var file (ie emc.var) for 5161, 5162, 5163 etc...

The values must be in the units in use when the G28 is issued.

HTH
Regards
TK

On 12/28/2015 1:36 PM, Hardy Family hardy.woodland.cypress@... [DynoMotion] wrote:
 
The persist data is not the same as g-code variables.  Your code is setting some random location in kflop memory since there's only 200 locations in persist.UserData.  Tom has some examples of setting g-code variables - you need to look at the PC communications examples.  G-code variables are only stored on the PC.

Also, the g-code variables would not be in steps, but would be in mm or inch units.  Not sure whether the interpreter automatically converts between mm and inch when you change g20/g21.  So it's probably best to leave those vars as zero, and adjust the zero absolute positions in the kflop so that the g28 home position is where you want it.  Personally, I prefer to use g53g0z<whatever> as a safer alternative to g28, but YMMV.

It would be nice if G28/30 could invoke "user program actions" like the M codes, but it doesn't yet as far as I know.

Regards,
SJH


On Mon, Dec 28, 2015 at 9:38 AM, wastingtape@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

I've been trying to figure this out on my own, and here's what I've got so far, but it does not seem to work...


#include "KMotionDef.h"


main()

{

// Set G28 home position

persist.UserData[5161]= 0; //X

persist.UserData[5162]= 93952; //Y

persist.UserData[5163]= 59880; //Z

ch0->InputMode=NO_INPUT_MODE;

        // More channel setup code here...


G28 still sends the machine to some random location.  Am I correct in assuming the value of the 5161-5163 variables are the step counts?  What am I missing?